load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "issues",
    srcs = [
        "condense.go",
        "formatter_unit.go",
        "issues.go",
        "render.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/cmd/bazci/githubpost/issues",
    visibility = [
        "//pkg/build/engflow:__pkg__",
        "//pkg/cmd:__subpackages__",
    ],
    deps = [
        "//pkg/build",
        "//pkg/util/version",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_google_go_github//github",
        "@org_golang_x_oauth2//:oauth2",
    ],
)

go_test(
    name = "issues_test",
    size = "small",
    srcs = [
        "condense_test.go",
        "issues_test.go",
        "render_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":issues"],
    deps = [
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/skip",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_google_go_github//github",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
    ],
)
